#!/usr/bin/perl -w
use strict;

my %hash_count;
my %hash_read;
my %hash_qlty;

while(<>){
	chomp $_;
	$_ =~ /(.*)(\t)(.*)(\t)(.*)(\t)(.*)(\t)(.*)(\t)(.*)/;
#############################################################################	
######### gi|49175990|ref|NC_000913.2|    1077    G       1       .       2
######### print "1:$1 2:$3 3:$5 4:$7 5:$9 6:$11\n";
######### 1:gi|49175990|ref|NC_000913.2| 2:136201 3:G 4:1 5:, 6:2
#############################################################################	
	$hash_count{$1."\t".$3."\t".$5} += $7;
	$hash_read{$1."\t".$3."\t".$5} .= $9;
	$hash_qlty{$1."\t".$3."\t".$5} .= $11;
}

print STDERR "MID_OF wrap_merge.pl\n";

foreach my $key (keys %hash_count){
	print "$key\t$hash_count{$key}\t$hash_read{$key}\t$hash_qlty{$key}\n";
}

print STDERR "END_OF wrap_merge.pl\n";
